{% set pypi_name = 'monasca-common' %}
{% set source = fetch_source('https://tarballs.openstack.org/monasca-common/monasca-common-master.tar.gz') %}
{% set upstream_version = upstream_version() %}
{% set rpm_release = '1' %}

%global sname {{ pypi_name }}
Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Reusable code for building monitoring related services.
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://wiki.openstack.org/wiki/Monasca
Source0:        {{ source|basename }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('PyMySQL') }}
BuildRequires:  {{ py3('confluent-kafka') }}
BuildRequires:  {{ py3('kazoo') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('oslo.config') }}
BuildRequires:  {{ py3('oslo.context') }}
BuildRequires:  {{ py3('oslo.policy') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('pyparsing') }}
BuildRequires:  {{ py3('requests-mock') }}
BuildRequires:  {{ py3('simplejson') }}
BuildRequires:  {{ py3('six') }}
BuildRequires:  {{ py3('stestr') }}
BuildArch:      noarch

%description
Collection of sub-projects containing reusable application and
platform code for building monitoring related services.

%package -n python3-monasca-common
Summary:        Reusable code for building monitoring related services.
Requires:       {{ py3('PyMySQL') }}
Requires:       {{ py3('confluent-kafka') }}
Requires:       {{ py3('kazoo') }}
Requires:       {{ py3('oslo.config') }}
Requires:       {{ py3('oslo.policy') }}
Requires:       {{ py3('pyparsing') }}
Requires:       {{ py3('simplejson') }}
Requires:       {{ py3('six') }}

%description -n python3-monasca-common
Collection of sub-projects containing reusable application and
platform code for building monitoring related services.

This package contains the Python 3.x module.

%prep
%autosetup -n %{sname}-{{ upstream_version }}
%py_req_cleanup

%build
export LC_ALL=en_US.utf-8
%{py3_build}

%install
export LC_ALL=en_US.utf-8
%{py3_install}

#%if 0%{?suse_version}
%check
export LC_ALL=en_US.utf-8
python3 -m stestr.cli run
#%endif

%files -n python3-monasca-common
%license LICENSE
%doc README.rst ChangeLog
%{python3_sitelib}/monasca_common
%{python3_sitelib}/*.egg-info

%changelog
